/**
 * Created by Administrator on 2017/6/13.
 */

var Poker = require('../Poker/Poker');

exports.qZhuangMode = {
    "GDQZ" : 1,     // 固定庄家
    "ZYQZ" : 2,     // 自由抢庄
    "MPQZ" : 3,     // 明牌抢庄
    "TBNN" : 4      // 通比牛牛
};

exports.defaultConst = {
    bet : 1,
    wuXiaoNiuValue : 10
};

exports.addRule = {
    "1" : [1, 2],
    "2" : [2, 4],
    "3" : [4, 8]
};

var pattern = {
        "wuNiu" : 1,        // 无牛
        "niuYi" : 2,        // 牛一
        "niuEr" : 3,        // 牛二
        "niuSan" : 4,       // 牛三
        "niuSi" : 5,        // 牛四
        "niuWu" : 6,        // 牛五
        "niuLiu"  : 7,      // 牛六
        "niuQi" : 8,        // 牛七
        "niuBa" : 9,        // 牛八
        "niuJiu" : 10,      // 牛九
        "niuniu" : 11,      // 牛牛
        "kanDou" : 12,      // 坎斗
        "shunDou": 13,      // 顺斗
        "tongHua": 14,      // 同花 
        "shunZi": 15,       // 顺子
        "tongHuaShun":16,   // 同花顺
        "wuHuaNiu" : 17,    // 五花牛
        "boomNiu" : 18,     // 炸弹牛
        "wuXiaoNiu" : 19    // 五小牛
};

var patternScore = {};
patternScore[pattern.wuNiu] = 1;
patternScore[pattern.niuYi] = 1;
patternScore[pattern.niuEr] = 1;
patternScore[pattern.niuSan] = 1;
patternScore[pattern.niuSi] = 1;
patternScore[pattern.niuWu] = 1;
patternScore[pattern.niuLiu] = 1;
patternScore[pattern.niuQi] = 1;
patternScore[pattern.niuBa] = 2;
patternScore[pattern.niuJiu] = 2;
patternScore[pattern.niuniu] = 3;
patternScore[pattern.kanDou] = 4;
patternScore[pattern.shunDou] = 4;
patternScore[pattern.tongHua] = 4;
patternScore[pattern.shunZi] = 4;
patternScore[pattern.tongHuaShun] = 4;
patternScore[pattern.wuHuaNiu] = 5;
patternScore[pattern.boomNiu] = 6;
patternScore[pattern.wuXiaoNiu] = 8;

var specRule = {};
specRule["bottom"] = pattern.niuQi;
specRule[pattern.niuQi] = 2;
specRule[pattern.niuBa] = 2;
specRule[pattern.niuJiu] = 3;
specRule[pattern.niuniu] = 4;
specRule["top"] = pattern.niuniu;

var baseRule = {
    "1/2" : 1,
    "2/4" : 2,
    "4/8" : 3
};

var tuiRule = {};
var rule1 = {};
rule1[pattern.niuQi] = 3;
rule1[pattern.niuBa] = 4;
rule1[pattern.niuJiu] = 5;
rule1[pattern.niuniu] = 10;
tuiRule[baseRule["1/2"]] = rule1;

var rule2 = {};
rule2[pattern.niuQi] = 6;
rule2[pattern.niuBa] = 8;
rule2[pattern.niuJiu] = 10;
rule2[pattern.niuniu] = 20;
tuiRule[baseRule["2/4"]] = rule2;

var rule3 = {};
rule3[pattern.niuQi] = 12;
rule3[pattern.niuBa] = 16;
rule3[pattern.niuJiu] = 20;
rule3[pattern.niuniu] = 40;
tuiRule[baseRule["4/8"]] = rule3;

// 用于处理游戏可用的常量
exports.SpecRule = specRule;
exports.BaseRule = baseRule;
exports.TuiRule = tuiRule;
exports.Pattern = pattern;
exports.PatternScore = patternScore;